class InclusionsController < ApplicationController
  # GET /inclusions
  # GET /inclusions.xml
  def index
    @inclusions = Inclusion.find(:all)

    respond_to do |format|
      format.html # index.erb
      format.xml  { render :xml => @inclusions.to_xml }
    end
  end

  # GET /inclusions/1
  # GET /inclusions/1.xml
  def show
    @inclusion = Inclusion.find(params[:id])

    respond_to do |format|
      format.html # show.erb
      format.xml  { render :xml => @inclusion.to_xml }
    end
  end

  # GET /inclusions/new
  def new
    @inclusion = Inclusion.new
  end

  # GET /inclusions/1;edit
  def edit
    @inclusion = Inclusion.find(params[:id])
  end

  # POST /inclusions
  # POST /inclusions.xml
  def create
    @inclusion = Inclusion.new(params[:inclusion])

    respond_to do |format|
      if @inclusion.save
        flash[:notice] = 'Inclusion was successfully created.'
        format.html { redirect_to inclusion_url(@inclusion) }
        format.xml  { head :created, :location => inclusion_url(@inclusion) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @inclusion.errors.to_xml }
      end
    end
  end

  # PUT /inclusions/1
  # PUT /inclusions/1.xml
  def update
    @inclusion = Inclusion.find(params[:id])

    respond_to do |format|
      if @inclusion.update_attributes(params[:inclusion])
        flash[:notice] = 'Inclusion was successfully updated.'
        format.html { redirect_to inclusion_url(@inclusion) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @inclusion.errors.to_xml }
      end
    end
  end

  # DELETE /inclusions/1
  # DELETE /inclusions/1.xml
  def destroy
    @inclusion = Inclusion.find(params[:id])
    @inclusion.destroy

    respond_to do |format|
      format.html { redirect_to inclusions_url }
      format.xml  { head :ok }
    end
  end
end
